/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.asistente.entidades;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Wizard
 */
@Entity
@Table(name = "hd_clasificacion_mayor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HdClasificacionMayor.findAll", query = "SELECT h FROM HdClasificacionMayor h"),
    @NamedQuery(name = "HdClasificacionMayor.findByCodNivel1", query = "SELECT h FROM HdClasificacionMayor h WHERE h.codNivel1 = :codNivel1"),
    @NamedQuery(name = "HdClasificacionMayor.findByDesNivel1", query = "SELECT h FROM HdClasificacionMayor h WHERE h.desNivel1 = :desNivel1"),
    @NamedQuery(name = "HdClasificacionMayor.findByIndEstadoNivel1", query = "SELECT h FROM HdClasificacionMayor h WHERE h.indEstadoNivel1 = :indEstadoNivel1")})
public class HdClasificacionMayor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "COD_NIVEL1")
    private Integer codNivel1;
    @Size(max = 50)
    @Column(name = "DES_NIVEL1")
    private String desNivel1;
    @Column(name = "IND_ESTADO_NIVEL1")
    private Character indEstadoNivel1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "codNivel1", fetch = FetchType.LAZY)
    private Collection<HdClasificacionMedia> hdClasificacionMediaCollection;

    public HdClasificacionMayor() {
    }

    public HdClasificacionMayor(Integer codNivel1) {
        this.codNivel1 = codNivel1;
    }

    public Integer getCodNivel1() {
        return codNivel1;
    }

    public void setCodNivel1(Integer codNivel1) {
        this.codNivel1 = codNivel1;
    }

    public String getDesNivel1() {
        return desNivel1;
    }

    public void setDesNivel1(String desNivel1) {
        this.desNivel1 = desNivel1;
    }

    public Character getIndEstadoNivel1() {
        return indEstadoNivel1;
    }

    public void setIndEstadoNivel1(Character indEstadoNivel1) {
        this.indEstadoNivel1 = indEstadoNivel1;
    }

    @XmlTransient
    public Collection<HdClasificacionMedia> getHdClasificacionMediaCollection() {
        return hdClasificacionMediaCollection;
    }

    public void setHdClasificacionMediaCollection(Collection<HdClasificacionMedia> hdClasificacionMediaCollection) {
        this.hdClasificacionMediaCollection = hdClasificacionMediaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codNivel1 != null ? codNivel1.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HdClasificacionMayor)) {
            return false;
        }
        HdClasificacionMayor other = (HdClasificacionMayor) object;
        if ((this.codNivel1 == null && other.codNivel1 != null) || (this.codNivel1 != null && !this.codNivel1.equals(other.codNivel1))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.asistente.DAO.HdClasificacionMayor[ codNivel1=" + codNivel1 + " ]";
    }
    
}
